<script>
    function color() {
        var a = ['#']
        for (i = 1; i < 7; i++) {
            do {
                h = Math.floor(Math.random() * 100)
            } while (h > 15)
            zm = ['a', 'b', 'c', 'd', 'e', 'f']
            if (h > 9)
                h = zm[h - 10]
            a[i] = h
        }
        return a.join('')
    }
    alert(color())
</script>